//
//  ZYCCustomButton.m
//  ZDSC
//
//  Created by 张威 on 2021/10/22.
//

#import "ZYCCustomButton.h"

@implementation ZYCCustomButton

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self addSubview:self.titleLab];
        [self addSubview:self.iconView];
        [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.equalTo(self.mas_centerX).offset(-1.5f);
        }];
        
        [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(self.mas_centerX).offset(1.5f);;
            make.size.mas_equalTo(CGSizeMake(22.5, 22.5));
        }];
    }
    return self;
}


- (UILabel *)titleLab {
    if (!_titleLab) {
        _titleLab = [[UILabel alloc] init];
        _titleLab.font = kCustomFont(@"PingFangSC-Regular", 15.0f);
    }
    return _titleLab;
}

- (UIImageView *)iconView {
    if (!_iconView) {
        _iconView = [[UIImageView alloc] init];
    }
    return _iconView;
}

@end
